﻿using UnityEngine;
using System.Collections;

public class BulletDestroyScript : MonoBehaviour {

//	void Start () {
//		Destroy (gameObject, 2f);
//	}

	void OnEnable(){	
		//Debug.Log ("OnEnable运行");
		Invoke ("Destroy", 2f);
	}

	void Destroy(){
		//Debug.Log ("销毁子弹 Destroy 运行");
		gameObject.SetActive (false);
	}

	void OnDisable(){
		//Debug.Log (" OnDisable 运行");
		CancelInvoke ();    // 在这里用合适吗
	}
}
